dmotor_com=serial('COM4','BaudRate',9600);
fopen(motor_com);
fprintf(motor_com,'en\n');  %% for MCBL 3006S-RS, T-1A new control box.

while(isStopped(motor_com)>0)
    pause(0.5);
end

disp('Initialization of the motor');
fprintf(motor_com,'enprog\n');
fprintf(motor_com,'jmp19\n');
fclose(motor_com);

disp('Locking FB...');
pause(18);
disp('Before restart, please DISCONNECT motor, REVERSE shaft, then use either motor_zero.m!');